public abstract class EventBase {
	protected int executionTime;
	private boolean isScheduled = false;
	private int id;
	
	public EventBase() {
		this.id = Simulator.nextId();
	}

	public int getId() {
		return id;
	}
	
	public EventBase(int timeUntilExecution) {
		this.executionTime = Simulator.currentTime + timeUntilExecution;
		isScheduled = true;
	}
	
	public String toString() {
		return "<" + this.getClass().getName() + ": " + executionTime + ">";
	}
	
	public boolean isScheduledEvent() {
		return isScheduled;
	}
	
	public boolean canOccur(State state) {
		if(isScheduled) {
			if(Simulator.currentTime == executionTime)
				return true;
			else
				return false;
		}
		return true;
	}
	
	public abstract void execute(State state);
}
